package com.zyzd.custom.module;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.zyzd.custom.R;
import com.zyzd.custom.widget.cardbagview.CardBagBean;
import com.zyzd.custom.widget.cardbagview.CardBagView;

import java.util.ArrayList;

public class CardbagActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cardbag);

        final ArrayList<CardBagBean> datas = new ArrayList<>();

        CardBagBean cardBagBean = new CardBagBean();
        cardBagBean.setIconUrl("http://f.hiphotos.baidu.com/image/h%3D300/sign=04083ce4fa03738dc14a0a22831bb073/08f790529822720eb1faa1be77cb0a46f21fabba.jpg");
        cardBagBean.setBackRes(R.drawable.shape_bg_module_card);
        cardBagBean.setTitle("第一张卡");
        datas.add(cardBagBean);

        cardBagBean = new CardBagBean();
        cardBagBean.setIconUrl("http://img4.imgtn.bdimg.com/it/u=3380046556,3880014502&fm=27&gp=0.jpg");
        cardBagBean.setBackRes(R.drawable.shape_bg_module_card_gray);
        cardBagBean.setTitle("第二张卡");
        datas.add(cardBagBean);

        cardBagBean = new CardBagBean();
        cardBagBean.setIconUrl("http://f.hiphotos.baidu.com/image/h%3D300/sign=04083ce4fa03738dc14a0a22831bb073/08f790529822720eb1faa1be77cb0a46f21fabba.jpg");
        cardBagBean.setBackRes(R.drawable.shape_bg_module_card);
        cardBagBean.setTitle("第三张卡");
        cardBagBean.setExpansion(true);
        datas.add(cardBagBean);

        ((CardBagView) findViewById(R.id.cardBagView)).setData(datas);
    }
}
